#ifndef BINARY_TREE_H_H_H
#define BINARY_TREE_H_H_H

struct node {
	int key;
	node* lchild;
	node* rchild;
};

class BinarySearchTree {
public:
	static BinarySearchTree* Instance();
	void CreateTree(node*&, int);
	node* Search(node*, int);
	node* ModifiedSearch(node*, int);	
	void Insert(node*&, int);		
	int Depth(node*);
	void InOrder(node*);
	void PreOrder(node*);
	void PostOrder(node*);		
	void IterInOrder(node*);
	void IterPreOrder(node*);
	void IterPostOrder(node*);		
	bool IsBalanced(node*, int&);

protected:
	BinarySearchTree() {}

private:
	static BinarySearchTree* m_instance;
};

#endif
